<?
session_start();
if($_SESSION['logmit']!=$_GET ['id']){echo "Ошибка: 713"; exit;}
$prof = $_GET ['id'];
include('/config/config.php');
if(!file_exists($pdir.$prof."/"."id.php")){echo "Ошибка: 1943"; exit;}
include($pdir.$prof."/"."id.php");
$date=date("d.m.Y");
$date2=date("H:i");
$date3 = $date2 . " " . $date;
$msg = $_POST['msg'];
$img_url = $_POST['img_url'];
if(iconv_strlen($msg, 'utf-8') <= $simb_index && strlen($msg)>2){
$img_url = str_replace("http://", '', $img_url);
if ($img_url==''){$img_url="gogolev.net/sites/default/files/no-www.png";}
$msg = str_replace("\n", ' {%}', $msg);
$msg = str_replace('\"','"',$msg);
$msg = str_replace("\'",'"',$msg);
$msg = str_replace("{DT}",$date3,$msg);
$msg = str_replace("{T}",$date2,$msg);
$msg = str_replace("{D}",$date,$msg);
$msg = str_replace("|||","|",$msg);
$message = $img_url . "|||" . $msg . "|||" . $date3."|||".$id;
$rdir = $pdirr . "/record.php";
if (file_exists($rdir)){
$id++;
$txt='
<?php
$id='.$id.';
?>';
$fs=fopen($pdir.$prof."/"."id.php", 'w');
fwrite($fs, $txt);
fclose($fs);
$rec=file_get_contents($rdir);
$message = $message . "\n" . $rec;
$fs=fopen($rdir, 'w');
fwrite($fs, $message);
fclose($fs);
$outm = str_replace ("%DATE%", $date3, $msg_sh);
$outm = str_replace ("%MSG%", $msg,$outm);
$outm = str_replace ("%ID%", $id,$outm);
$outm = str_replace ("%DEL%", '', $outm);
$outm = str_replace("{%}", '<br>', $outm);
$outm = str_replace('\"','"',$outm);
$outm = str_replace("\'","'",$outm);
$outm = str_replace("{DT}",$date3,$outm);
$outm = str_replace("{T}",$date2,$outm);
$outm = str_replace("{D}",$date,$outm);
$outm = str_replace("|||","|",$outm);
$outm= preg_replace($regular['1'],"<a href=\"$1\" target=\"_blank\">$1</a>",$outm);
$outm= preg_replace($regular['2'],"<a href=\"http://$1\" target=\"_blank\">$1</a>",$outm);
$outm = str_replace ("%IMG%", $img_url, $outm);
$outm = preg_replace ($regular['3'], "<a href=\"?prof=$1\">$1</a>", $outm);
$outm = preg_replace ($regular['4'], "prof=", $outm);
echo $outm;
exit;
} else {echo "Ошибка: 1734"; exit;} } else {echo "Ошибка: 273 ".iconv_strlen($msg, 'utf-8'); exit;}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV=REFRESH CONTENT="0; URL=/?prof=<?=$_GET ['id'];?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OP</title>
</head>
<body style="background-color:#FFFFFF">
</body>
</html>
